//js获取url传参
function getParam(name){
    var search = document.location.search;
    var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");
    var matcher = pattern.exec(search);
    var items = null;
    if(null != matcher){
        try{
            items = decodeURIComponent(decodeURIComponent(matcher[1]));
        }catch(e){
            try{
                items = decodeURIComponent(matcher[1]);
            }catch(e){
                items = matcher[1];
            }
        }
    }
    return items;
};
function query() {
    var grade=$("#grade option:selected").val();
    var term=$("#term option:selected").val();
    open("/ClassServlet?action=getSchedule&grade="+grade+"&term="+term,"class_content");
}
$(document).ready(function () {
    $("#grade option").each(function () {
        if($(this).val()==getParam("grade")){
            $(this).attr("selected","selected");
        }else {
            $(this).removeAttr("selected");
        }
    });
    $("#term option").each(function () {
        if($(this).val()==getParam("term")){
            $(this).attr("selected","selected");
        }else {
            $(this).removeAttr("selected");
        }
    });

    $("#CssScheduleTable").attr("class","active");
});